package com.songlanyun.modules.singlegoods.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.util.Date;

import com.songlanyun.common.drive.RootEntity;
import com.songlanyun.modules.account.entity.UserInfoEntity;
import com.songlanyun.modules.account.service.UserInfoService;
import com.songlanyun.modules.goods.entity.Goods;
import com.songlanyun.modules.goods.entity.GoodsContent;
import com.songlanyun.modules.goods.service.GoodsContentService;
import com.songlanyun.modules.goods.service.GoodsService;
import com.songlanyun.modules.rabbitmq.util.SpringContextUtil;
import com.songlanyun.modules.singlegoods.service.ProductSingleGoodsService;
import lombok.Data;

/**
 * 库存不足记录表
 *
 * @author wuchao
 * @email sunlightcs@gmail.com
 * @date 2021-03-18 15:09:05
 */
@Data
@TableName("yxt_product_under_stock_record")
public class UnderStockRecordEntity extends RootEntity<Long, UnderStockRecordEntity> implements Serializable {
    private static final long serialVersionUID = 1L;

    public UnderStockRecordEntity() {
    }

    public UnderStockRecordEntity(Long shopId, Long goodsId, Long singleGoodsId,
                                  String skuSetName, Integer buyNum, Integer singleGoodsNum) {
        this.shopId = shopId;
        this.goodsId = goodsId;
        this.singleGoodsId = singleGoodsId;
        this.skuSetName = skuSetName;
        this.buyNum = buyNum;
        this.singleGoodsNum = singleGoodsNum;
    }

    /**
     *
     */
    @TableId
    private Long id;

    /**
     * 商家id
     */
    private Long shopId;
    /**
     * 商品id
     */
    private Long goodsId;

    /**
     * 库存不足的单品id
     */
    private Long singleGoodsId;

    /**
     * sku
     */
    private String skuSetName;
    /**
     * 购买数量
     */
    private Integer buyNum;
    /**
     * 单品剩余数量
     */
    private Integer singleGoodsNum;

    /**
     * 商家是否手动添加库存
     */
    private Boolean IsInStock;
    /**
     *
     */
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;


    @Override
    public Long getIdentity() {
        return this.getId();
    }
}
